package cn.gem.rainbow.cfg.web.filter;

import lombok.extern.log4j.Log4j2;

import javax.servlet.*;
import java.io.IOException;
@Log4j2
public class DoubleReqFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        log.info("" + getClass() + " init");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info("" + getClass() + " 对请求参数等进行预处理" );
        chain.doFilter(request, response);
        log.info("" + getClass() + " 对响应结果进行预处理" );

    }

    @Override
    public void destroy() {
        log.info("" + getClass() + " destroy");
    }
}
